<?php
	
	
	$link = @mysql_connect("localhost","root","");
	@mysql_query("set names 'UTF8'");
	@mysql_select_db("valspar") or die("can not select database");
	
	if ($_POST['photoname']=='ashley-hebert')
		$dbnumber = 2;
	else if ($_POST['photoname']=='bette-middler')
		$dbnumber = 3;
	else if ($_POST['photoname']=='brooke-burke')
		$dbnumber = 4;
	else if ($_POST['photoname']=='eric-close')
		$dbnumber = 5;
	else if ($_POST['photoname']=='ethan-hawke')
		$dbnumber = 6;
	else if ($_POST['photoname']=='Fergie')
		$dbnumber = 7;
	else if ($_POST['photoname']=='genevieve-gorder')
		$dbnumber = 8;
	else if ($_POST['photoname']=='Heather-Graham')
		$dbnumber = 9;
	else if ($_POST['photoname']=='jenna-elfman')
		$dbnumber = 10;
	else if ($_POST['photoname']=='Jenny-McCarthy')
		$dbnumber = 11;
	else if ($_POST['photoname']=='Jillian-Michaels')
		$dbnumber = 12;
	else if ($_POST['photoname']=='Jonathan-Groff')
		$dbnumber = 13;
	else if ($_POST['photoname']=='Josh-Duhamel')
		$dbnumber = 14;
	else if ($_POST['photoname']=='jp-rosenbaum')
		$dbnumber = 15;
	else if ($_POST['photoname']=='kate-bosworth')
		$dbnumber = 16;
	else if ($_POST['photoname']=='Kelly-Rutherford')
		$dbnumber = 17;
	else if ($_POST['photoname']=='Lea-Michele')
		$dbnumber = 18;
	else if ($_POST['photoname']=='liev-schreiber')
		$dbnumber = 19;
	else if ($_POST['photoname']=='Marcia-Cross')
		$dbnumber = 20;
	else if ($_POST['photoname']=='miles-redd')
		$dbnumber = 21;
	else if ($_POST['photoname']=='Minka-Kelly')
		$dbnumber = 22;
	else if ($_POST['photoname']=='mischa-barton')
		$dbnumber = 23;
	else if ($_POST['photoname']=='naomi-watts')
		$dbnumber = 24;
	else if ($_POST['photoname']=='rosanne-cash')
		$dbnumber = 25;
	else if ($_POST['photoname']=='stacy-keibler')
		$dbnumber = 26;
	else if ($_POST['photoname']=='susan-sarandon')
		$dbnumber = 27;
	else if ($_POST['photoname']=='taylor-spreitler')
		$dbnumber = 28;
	else if ($_POST['photoname']=='Warren-Haynes')
		$dbnumber = 29;
	else
		$dbnumber = 1;
	
	if ($_POST['type']=='visitapp')
		$sql="INSERT INTO ".$_POST['type']." VALUES ();";
	else
		$sql="INSERT INTO ".$_POST['type']." (Photo_id) VALUES(".$dbnumber.");";
	
	mysql_query($sql);
	
?>